<template>
	<div class="box">{{ a }}</div>
	<Input v-model="box.sub.a" placeholder=""></Input>
</template>

<script>
class MyBox {
	constructor() {
		this.a = 1;
		this.sub = new MyBoxSub()
	}
	init() {
		console.log(this.sub);
		this.sub.init();
	}
}
class MyBoxSub {
	constructor() {
		this.a = 1;
		// setInterval(() => {
		// 	console.log(`this`, this);
		// 	this.a++
		// }, 1e3);
	}
	init() {
		setInterval(() => {
			// console.log(`this`, this);
			this.a++
		}, 1e3);
	}
}
export default {
	data() {
		return {
			box: new MyBox()
		}
	},
	created() {
		this.box.init();
	}
}
</script>

<style lang="scss" scoped>
.box {
	width: 100px;
	height: 100px;
	border: 1px solid #000;
}
</style>